#include "comm.hpp"
using std::cout;
using std::endl;

int main()
{
    int shmid =CreateShm();
    char* pshm=(char*)shmat(shmid,nullptr,0);
     struct shmid_ds shmds;
    while(true)
    {
        std::cout<<shmid<<"shmb say@:"<<pshm<<std::endl;
        //  shmctl(shmid, IPC_STAT, &shmds);
        //  cout << "shm size: " << shmds.shm_segsz << endl;
        // cout << "shm nattch: " << shmds.shm_nattch << endl;
        // printf("shm key: 0x%x\n",  shmds.shm_perm.__key);
        // cout << "shm mode: " << shmds.shm_perm.mode << endl;
        sleep(1);
    }
    shmdt(pshm);
    return 0;
}